﻿using System.Collections.Generic;
using Bogus;
using TodoApp.Models;
namespace TodoApp.CreateDb.Faker
{
    //Fakers类:使用了 Bogus 库来生成伪造（模拟）的 TodoItem 数据
    public class Fakers
    {
        private Faker<TodoItem> _todoitemFaker;
        private int _Ids = 1;
        public Fakers()
        {
            int Ids = 1;
            _todoitemFaker = new Faker<TodoItem>()
                .RuleFor(i => i.Id, f => _Ids++)
                .RuleFor(i => i.Name, f => f.Name.FullName())
                .RuleFor(i => i.IsComplete, f => f.PickRandom(new bool[] { true,false}));           
        }

        public Faker<TodoItem> TodoItemFaker
        {

            get { return _todoitemFaker; }
            
        }

    }
}